package com.gao.interceptordemo.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 松散绑定:yml中写last-name,-后跟着的字母默认大写的
 * @author 高枫
 * @author gaofeng
 * date 2021年09月25日 15:58
 */
@Component
@ConfigurationProperties(prefix = "cat")
public class Cat {
    @Value("金渐层")
    private String firstName ;
    private Integer age ;

    public Cat() {
    }

    public Cat(String firstName, Integer age) {
        this.firstName = firstName;
        this.age = age;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Cat{" +
                "firstName='" + firstName + '\'' +
                ", age=" + age +
                '}';
    }
}
